<template>
    <div class="father7">
        <!-- 不携带参数的自定义事件 -->
        <Child7 @show-msg="showMsg"></Child7>
        <!-- 携带参数的自定义事件 -->
        <Child8 @get-data-from-child-8="getMsg"></Child8>
    </div>
</template>

<script>
import Child7 from './Child7.vue';
import Child8 from './Child8.vue';

export default {
    name: 'Father7',
    components: {Child7, Child8},
    methods: {
        showMsg() {
            alert('触发了自定义事件');
        },
        getMsg(msg) {
            alert('父组件从子组件接收到了信息： ' + msg);
        }
    }
}
</script>

<style>

</style>